package com.wuyu.mini.dubbo.registry.redis;

import com.wuyu.mini.dubbo.registry.AbstractRegistry;
import java.util.List;

/**
 * redis 服务注册实现
 */
public class RedisRegistryImpl extends AbstractRegistry {

    protected void init(String address) {
        RedisOparetor.init(address);
    }

    protected List<String> lookup(String service) {
        List<String> lrange = RedisOparetor.getJedis().lrange(FOLDER + SEPARATOR + service, 0, -1);
        return lrange;
    }

    public void register(String providerAddress, String service) {
        RedisOparetor.getJedis().lpush(FOLDER + SEPARATOR + service, providerAddress);
    }
}
